<?php

namespace wangk\openapi\openapi\config;

use InvalidArgumentException;

class Config
{
    private $appKey;
    private $appSecret;
    private $requestUrl;

     const TEST_REQUEST_URL = 'http://test.saas.dev.aiksbox.com/';
     const PRODUCT_REQUEST_URL = 'http://api.sas.aiksbox.com/';


    public function __construct($appKey = '', $appSecret = '', $env = 'product')
    {
        if (empty($appKey)) {
            throw new InvalidArgumentException("app_key is required");
        }
        if (empty($appSecret)) {
            throw new InvalidArgumentException("app_secret is required");
        }

        $this->appKey = $appKey;
        $this->appSecret = $appSecret;
        $this->requestUrl = $env === 'product' ? self::PRODUCT_REQUEST_URL : self::TEST_REQUEST_URL;
    }

    public function getAppKey()
    {
        return $this->appKey;
    }

    public function getAppSecret()
    {
        return $this->appSecret;
    }

    public function requestUrl()
    {
        return $this->requestUrl;
    }
}